<div class="coreGroups form">
    <?php echo $this->Form->create('CoreGroup'); ?>
    <fieldset>
        <legend><?php echo __('Edit Core Group'); ?></legend>
        <?php
        echo $this->Form->input('id');
        echo $this->Form->input('cogr_name');
        echo $this->Form->input('cogr_desc');
        echo $this->Form->input('cogr_status', array('options' => array('a' => __('Active'), 'i' => __('Inactive')), 'default' => 'a'));
        echo $this->Form->input('cogr_public');
        foreach ($modules as $key => $value) {
            $permition = $corePrivilegesGroupsModule->getPrivilegesFromModuleAndGroup($this->Form->value('CoreGroup.id'), $key);
            $options = array('' => __('None'), 'r_' . $key . '' => __('Read'), 'w_' . $key . '' => __('Write'), 'a_' . $key . '' => __('Admin'));
            $attributes = array('legend' => $value, 'label' => true, 'value' => "{$permition}_{$key}", 'class' => 'horizontal');
            echo $this->Form->radio('CoreModuleRead][' . $key . '', $options, $attributes);
        }
        ?>
    </fieldset>
    <?php echo $this->Form->end(__('Submit')); ?>
</div>
<div class="actions">
    <h3><?php echo __('Actions'); ?></h3>
    <ul>

        <li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('CoreGroup.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('CoreGroup.id'))); ?></li>
        <li><?php echo $this->Html->link(__('List Core Groups'), array('action' => 'index')); ?></li>
    </ul>
</div>
